<script type="text/html" template lay-done="layui.data.done(d);">
    <div class="layui-form coreshop-form layui-form-pane" lay-filter="LAY-app-CoreCmsAppUpdateLog-createForm" id="LAY-app-CoreCmsAppUpdateLog-createForm">

        <div class="layui-form-item">
            <label for="version" class="layui-form-label  layui-form-required">版本号</label>
            <div class="layui-input-inline layui-inline-6">
                <input type="number" min="0" max="999999" name="version" lay-verify="required|number" class="layui-input" value="1" placeholder="请输入版本号" lay-reqText="请输入版本号并为数字" />
            </div>
            <div class="layui-form-mid">
                应用版本号，必须为整数数字，升级时必须要高于上一次设置的值。
            </div>
        </div>

        <div class="layui-form-item">
            <label for="note" class="layui-form-label  layui-form-required">更新内容</label>
            <div class="layui-input-block">
                <input name="note" lay-verify="required|verifynote" class="layui-input" lay-reqText="请输入更新内容" placeholder="请输入更新内容" />
            </div>
        </div>

        <div class="layui-form-item">
            <label for="android" class="layui-form-label">安卓地址</label>
            <div class="layui-input-block">
                <input name="android" class="layui-input" lay-reqText="请输入安卓地址" placeholder="请输入安卓地址" />
            </div>
        </div>

        <div class="layui-form-item">
            <label for="ios" class="layui-form-label">IOS地址</label>
            <div class="layui-input-block">
                <input name="ios" class="layui-input" lay-reqText="请输入IOS地址" placeholder="请输入IOS地址" />
            </div>
        </div>

        <div class="layui-form-item" pane>
            <label for="isUpdate" class="layui-form-label  layui-form-required">开启更新</label>
            <div class="layui-input-block">
                <input type="checkbox" lay-filter="switch" name="isUpdate" lay-skin="switch" lay-text="开启|关闭">
            </div>
        </div>

        <div class="layui-form-item text-right core-hidden">
            <input type="button" class="layui-btn" lay-submit lay-filter="LAY-app-CoreCmsAppUpdateLog-createForm-submit" id="LAY-app-CoreCmsAppUpdateLog-createForm-submit" value="确认添加">
        </div>
    </div>
</script>
<script>
    var debug = layui.setter.debug;
    layui.data.done = function (d) {
        //开启调试情况下获取接口赋值数据
        if (debug) { console.log(d.params.data); }
        layui.use(['admin', 'form', 'laydate', 'upload', 'coreHelper', 'cropperImg'],
            function () {
                var $ = layui.$
                    , form = layui.form
                    , admin = layui.admin
                    , laydate = layui.laydate
                    , upload = layui.upload
                    , cropperImg = layui.cropperImg
                    , coreHelper = layui.coreHelper;

                laydate.render({
                    elem: '#createTime-CoreCmsAppUpdateLog-addTime',
                    type: 'datetime'
                });
                form.verify({

                    verifyversion: [/^.{0,50}$/, '版本号最大只允许输入50位字符'],
                    verifynote: [/^.{0,255}$/, '更新内容最大只允许输入255位字符'],
                    verifyandroid: [/^.{0,255}$/, '安卓地址最大只允许输入255位字符'],
                    verifyios: [/^.{0,255}$/, 'IOS地址最大只允许输入255位字符'],
                });
                //重载form
                form.render(null, 'LAY-app-CoreCmsAppUpdateLog-createForm');
            })
    };
</script>
